﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using BUS;
namespace t4_se
{
    public partial class TraCuuChuyenBay_HK : Form
    {
        public TraCuuChuyenBay_HK()
        {
            InitializeComponent();
        }
        public void HienThi()
        {
            this.dataGridView1.AutoGenerateColumns = false;
            String noiDi = comboBox1.SelectedValue.ToString();
            String noiDen = comboBox1.SelectedValue.ToString();
            DateTime ngayDi =dateTimePicker1.Value;
            this.dataGridView1.DataSource = ChuyenBay_BUS.traCuuChuyenBay(noiDi, noiDen, ngayDi);
        }
        private void TraCuuChuyenBay_Load(object sender, EventArgs e)
        {
            this.comboBox1.ValueMember = "Tinh";
            this.comboBox1.DisplayMember = "Tinh";
            this.comboBox4.ValueMember = "Tinh";
            this.comboBox4.DisplayMember = "Tinh"; 
            this.comboBox1.DataSource = ChuyenBay_BUS.layDanhSachChuyenBay();

            this.HienThi();
        }
        private void button_tim_Click(object sender, EventArgs e)
        {
            //Lấy thông tin 
            HienThi();
            
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            HienThi();
        }

        private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
        {
            HienThi();
        }

        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            HienThi();
        }

        private void button_Thoat_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            DangNhap frm = new DangNhap();
            frm.Show();
        }

    }
}
